home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / c / cxref_1_4a.lha / Makefile < prev    next >
Makefile  |  1997-12-07  |  6KB  |  192 lines

  1. # $Header: /home/amb/cxref/RCS/Makefile 1.34 1997/11/20 19:55:33 amb Exp $
  2. #
  3. # C Cross Referencing & Documentation tool. Version 1.4a.
  4. #
  5. # Program Makefile.
  6. #
  7. # Written by Andrew M. Bishop
  8. #
  9. # This file Copyright 1995,96 Andrew M. Bishop
  10. # It may be distributed under the GNU Public License, version 2, or
  11. # any higher version.  See section COPYING of the GNU Public license
  12. # for conditions under which this file may be redistributed.
  13. #
  14.  
  15. # Standard definitions, edit Makefile.config not this one.
  16. include ./Makefile.config
  17.  
  18. ########
  19.  
  20. INCLUDE=
  21. LIBRARY=
  22.  
  23. COMPILE=$(CC) -c $(CFLAGS)
  24.  
  25. LINK=$(LD) $(LDFLAGS)
  26.  
  27. ########
  28.  
  29. programs : cxref-cpp cxref cxref-query
  30.     @
  31.  
  32. docs : readme faq-html
  33.     cd doc && $(MAKE)
  34.  
  35. all : programs docs
  36.     @
  37.  
  38. ########
  39.  
  40. OBJ_FILES=func.o type.o var.o preproc.o comment.o file.o \
  41.           slist.o memory.o \
  42.           xref.o \
  43.           warn-raw.o latex.o latex-style.o \
  44.           html.o \
  45.           parse-lex.o parse-yacc.o
  46.  
  47. cxref : cxref.o $(OBJ_FILES)
  48.     $(LINK) cxref.o $(OBJ_FILES) -o $@ $(LIBRARY)
  49.  
  50. cxref-inst : cxref-inst.o $(OBJ_FILES)
  51.     $(LINK) cxref-inst.o $(OBJ_FILES) -o $@ $(LIBRARY)
  52.  
  53. ####
  54.  
  55. cxref-cpp : cpp/Makefile.cpp
  56.     cd cpp && $(MAKE) cxref-cpp
  57.  
  58. cpp/Makefile.cpp :
  59.     touch cpp/Makefile.cpp
  60.     cd cpp && $(MAKE) configure
  61.  
  62. ####
  63.  
  64. cxref-query :
  65.     cd query && $(MAKE) cxref-query
  66.  
  67. ########
  68.  
  69. faq-html : FAQ FAQ-html.pl
  70.     -[ $(PERL) ] && $(PERL) FAQ-html.pl < FAQ > FAQ.html
  71.  
  72. ####
  73.  
  74. readme : cxref cxref-cpp README.c
  75.     ./cxref -Odoc -NREADME -xref README.c
  76.     ./cxref -Odoc -NREADME -xref README.c -html -latex
  77.     cp doc/README.c.html README.c.html
  78.     cp doc/README.c.tex  README_c.tex
  79.     -[ $(LATEX) ] && $(LATEX) README.tex > /dev/null 2>&1
  80.     -[ $(LATEX) ] && $(LATEX) README.tex
  81.     -[ $(DVIPS) ] && $(DVIPS) README.dvi -o README.ps
  82.     @rm -f README.aux README.log README.toc doc/README.*
  83.  
  84. ########
  85.  
  86. install : programs cxref-inst
  87.     $(INSTALL) -d $(INSTDIR)/bin
  88.     $(INSTALL) -m 755 cxref-inst $(INSTDIR)/bin/cxref
  89.     -@rm cxref-inst
  90.     $(INSTALL) -m 755 query/cxref-query $(INSTDIR)/bin
  91.     [ ! -x cpp/cxref-cpp ] || $(INSTALL) -m 755 cpp/cxref-cpp $(INSTDIR)/bin
  92.     $(INSTALL) -d $(INSTDIR)/man/man1
  93.     $(INSTALL) -m 644 README.man $(INSTDIR)/man/man1/cxref.1
  94.     $(INSTALL) -m 644 query/README.man $(INSTDIR)/man/man1/cxref-query.1
  95.     [ ! -x cpp/cxref-cpp ] || $(INSTALL) -m 644 cpp/README.man $(INSTDIR)/man/man1/cxref-cpp.1
  96.  
  97. ########
  98.  
  99. clean :
  100.     -rm -f cxref core *.o *~ \
  101.     lex.*.c y.tab.* latex-style.c \
  102.     README.dvi README.ps
  103.  
  104. ####
  105.  
  106. allclean realclean : clean
  107.     cd doc && $(MAKE) clean
  108.     cd cpp && $(MAKE) clean
  109.     cd query && $(MAKE) clean
  110.  
  111. ########
  112.  
  113. parse-yacc.c : parse.y
  114.     $(YACC) -d parse.y
  115.     -@mv y.tab.c  parse-yacc.c
  116.     @echo Created parse-yacc.c
  117.  
  118. parse-yacc.h : parse-yacc.c
  119.     -@if cmp -s parse-yacc.h y.tab.h ; then : ; else \
  120.        if [ -f y.tab.h ] ; then \
  121.           cp y.tab.h parse-yacc.h ; \
  122.           echo Created parse-yacc.h ; \
  123.        fi \
  124.     fi
  125.  
  126. ####
  127.  
  128. parse-lex.c : parse.l
  129.     $(LEX) parse.l
  130.     -@mv lex.yy.c parse-lex.c
  131.     @echo Created parse-lex.c
  132.  
  133. ####
  134.  
  135. latex-style.c : doc/fonts.style doc/page.style doc/cxref.style
  136.     @echo '/** The style files needed for LaTeX. **/' >  latex-style.c
  137.     @echo ''                                          >> latex-style.c
  138.     @echo '/*+ The fonts style file as a string. +*/' >> latex-style.c
  139.     @echo 'char *latex_fonts_style='                  >> latex-style.c
  140.     @sed 's/\\/\\\\/g' doc/fonts.style \
  141.     |awk '{print "\"" $$0 "\\n\""}'                   >> latex-style.c
  142.     @echo ';'                                         >> latex-style.c
  143.     @echo ''                                          >> latex-style.c
  144.     @echo '/*+ The page style file as a string. +*/'  >> latex-style.c
  145.     @echo 'char *latex_page_style='                   >> latex-style.c
  146.     @sed 's/    CONFIG-ONLY PAGE=$(LATEX_PAGE)//g' doc/page.style \
  147.     |grep -v 'CONFIG-ONLY' \
  148.     |sed 's/\\/\\\\/g' \
  149.     |awk '{print "\"" $$0 "\\n\""}'                   >> latex-style.c
  150.     @echo ';'                                         >> latex-style.c
  151.     @echo ''                                          >> latex-style.c
  152.     @echo '/*+ The cxref style file as a string. +*/' >> latex-style.c
  153.     @echo 'char *latex_cxref_style='                  >> latex-style.c
  154.     @sed 's/\\/\\\\/g' doc/cxref.style \
  155.     |awk '{print "\"" $$0 "\\n\""}'                   >> latex-style.c
  156.     @echo ';'                                         >> latex-style.c
  157.     @echo Created latex-style.c
  158.  
  159. ####
  160.  
  161. %.o:%.c
  162.     $(COMPILE) $< -o $@ $(INCLUDE)
  163.  
  164. cxref.o      : cxref.c      cxref.h datatype.h   memory.h parse-yy.h
  165.     [ ! -x cpp/cxref-cpp ] || $(COMPILE) cxref.c -o $@ $(INCLUDE) "-DCXREF_CPP=\"$$PWD/cpp/cxref-cpp -C -dD -dI\""
  166.     [   -x cpp/cxref-cpp ] || $(COMPILE) cxref.c -o $@ $(INCLUDE)
  167.  
  168. cxref-inst.o : cxref.c      cxref.h datatype.h   memory.h parse-yy.h
  169.     [ ! -x cpp/cxref-cpp ] || $(COMPILE) cxref.c -o $@ $(INCLUDE) '-DCXREF_CPP="cxref-cpp -C -dD -dI"'
  170.     [   -x cpp/cxref-cpp ] || $(COMPILE) cxref.c -o $@ $(INCLUDE)
  171.  
  172. func.o       : func.c       cxref.h datatype.h   memory.h
  173. type.o       : type.c       cxref.h datatype.h   memory.h
  174. var.o        : var.c        cxref.h datatype.h   memory.h
  175. comment.o    : comment.c    cxref.h datatype.h   memory.h
  176. file.o       : file.c       cxref.h datatype.h   memory.h
  177. preproc.o    : preproc.c    cxref.h datatype.h   memory.h
  178.  
  179. slist.o      : slist.c      cxref.h datatype.h   memory.h
  180. memory.o     : memory.c                          memory.h
  181.  
  182. xref.o       : xref.c       cxref.h datatype.h   memory.h
  183. warn-raw.o   : warn-raw.c   cxref.h datatype.h   memory.h
  184. latex.o      : latex.c      cxref.h datatype.h   memory.h
  185. latex-style.o: latex-style.c
  186. html.o       : html.c       cxref.h datatype.h   memory.h
  187.  
  188. parse-yacc.o : parse-yacc.c cxref.h parse-yacc.h memory.h parse-yy.h
  189. parse-lex.o  : parse-lex.c  cxref.h parse-yacc.h memory.h parse-yy.h
  190.  
  191. ########
  192.